<?php

class AnimeController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $this->view->paginator = new Zend_Paginator(
            Ext_App::getTable('Model_DbTable_Anime')->fetchPaginatorAdapter()
        );
        $this->view->paginator->setCurrentPageNumber($this->_getParam('page', 1));
        $this->view->paginator->setItemCountPerPage(Ext_App::getSetting('limits.anime_per_page'));
        $this->view->paginator->setPageRange(Ext_App::getSetting('limits.page_range'));
    }

    public function viewAction()
    {
        if (null == ($this->view->anime = Ext_App::getTable('Model_DbTable_Anime')->findById($this->_getParam('id')))) {
            $this->_helper->error->notFound();
        }
    }
}

